﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using QLT_Public;
using QLT_BLL;
using QLThuoc_report;

namespace GiaoDien
{
    public partial class uc_ThongKe_ThuocBan_TheoNgay : DevExpress.XtraEditors.XtraUserControl
    {
        public uc_ThongKe_ThuocBan_TheoNgay()
        {
            InitializeComponent();
        }
        ThongKe_BLL thongKe_bll = new ThongKe_BLL();
        private void uc_ThongKe_ThuocBan_TheoNgay_Load(object sender, EventArgs e)
        {
            gridControl1.DataSource = thongKe_bll.Load_ThongKe_ThuocBan_TheoNgay();
        }

        private void dateTime_NgayBan_ValueChanged(object sender, EventArgs e)
        {
            CTHoaDonBH_Public ct = new CTHoaDonBH_Public();
            ct.NgayBan =Convert.ToDateTime( dateTime_NgayBan.Text);
            gridControl1.DataSource = thongKe_bll.ThongKe_ThuocBan_TheoNgay(ct);
        }

        private void bbi_Refresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            uc_ThongKe_ThuocBan_TheoNgay_Load(sender,e);
        }

        private void bbi_XemChiTiet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

        }

        private void bbi_In_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frm_TKeThuocTheoNgay f = new frm_TKeThuocTheoNgay();
            f.NgayBan=Convert.ToDateTime(dateTime_NgayBan.Text);
            f.ShowDialog();
        }
    }
}
